Copyright: Copyright 1996, 1997 Symantec Corporation
Citation: Reprint permission by Symantec Corporation, Visual Cafe 1997


Visual Cafe User's Guide 1.0 and 1.01 online help project

Do not add topics to this file. This is the base .doc file for help and is used for project information only.

This project contains concept information for Visual Cafe.

This project consists of these files:

vcgtext.doc	Concept text

defin.doc	Glossary of terms

This project includes the following:

vccafe.hlp	To allow Alink searches

The other piece of the Users Guide online help and online document project is the Visual Cafe online help. This project is vcafe.hpj. The user guide help links to the vcafe help through the How To button.  To enable this cross .hlp file linking, you must list both files in the Content Tab Composer>>Contents>>Setup...>> Link Files option. The Alinks of other .hlp files don't show up in the A word listing. You have to know the A word and type it in manually.

WARNING: For this project the Topic ID and A Search Word fields in the Topic definition must be EXACTLY the same and only use ONE A Search Word.

Other notes:

•	since this is a multiple writer project. Everyone should use shared templates robohelp.doc and robortf.dot


Overview of Visual Cafe

Symantec's Visual Cafe for Windows is the first complete Rapid Application Development (RAD) environment for Java. It provides an easy-to-use and seamlessly integrated visual development environment featuring a complete professional toolset. Visual Cafe allows you to create and debug web-hosted Java applets and stand-alone Java applications.

Featuring a sophisticated set of high level, two-way tools, Visual Cafe is the leading Java development environment:

•	Form-centric development environment with a powerful integrated form design tool.

•	Configurable widget palette contains your favorite form components.

•	Component Library contains a repository of components for forms, windows, and databases.

•	Supports add-in third party components via the extensible Component Library.

•	Interaction Wizard allows you to specify actions based on form components eventsEvents.

•	Form and property sheet modifications generate real-time source code.

•	Variables window incorporates a tree view to collapse and expand the various scopes.

Symantec’s Java compiler and the Visual Cafe Environment

The Symantec Java compiler that comes with Visual Cafe was written specifically for the Java language and is faster than Sun’s command line compiler -- in some cases as much as thirteen times faster. Instead of typing a string of commands at the command prompt, you click on a single icon to compile and execute a program.

Visual Cafe displays information in the Windows environment instead of at the DOS command line. Visual Cafe also provides useful, meaningful messages indicating how the compiling process is progressing.

In addition, Visual Cafe provides many Windows-based development tools not found in the JDK. Visual Cafe’s graphical development environment makes Java programming easier and faster.

Sun Microsystems’ Java Compiler and the JDK

When Sun Microsystems developed Java, they also created a compiler to convert Java source code into .class files.   The Java compiler developed by Sun is called “javac.exe”, and is run from a DOS command line. To compile a Java program you need to run javac.exe, passing the name of the source file, along with any other required parameters.

Sun’s Java compiler also comes with the Java Developers Kit, or JDK. The JDK is a collection of tools to help compile, debug, and test Java programs. The JDK, like Sun’s compiler, uses a command line interface.


Working Visually with Visual Cafe

You create cross-platform Java applets and applications by first designing the user-interface components,  and then using the various Visual Cafe tools to automate the process of deriving classes, creating interactions, coordinating text messages, and mapping functions to visual components and messages. You can do most of these tasks with the  by setting properties to define, refine, and control the appearance and behavior of your visual components.

Visual Cafe creates and updates the source code as you create the layout.   This feature of Visual Cafe allows you to concentrate on designing and allocating other resources for your applet or application. It is possible to design, develop, and build an applet  or application without having to write a single line of source code.

The Visual Cafe tools help you find and fix problems, reference the rules of the Java language, and organize the entire process of creating Java applets and applications.   Visual Cafe facilitates these tasks by providing an Integrated Development and Debugging Environment (IDDE). In other words, it is a single application that provides tools for the creation and development of a computer program.


Using Visual Cafe as Your Development Environment

When a development environment is said to be integrated, this means that the tools in the environment work together. For example, the compiler might find an error in the source code.   In addition to displaying the error, and with a double click on the highlighted error, Visual Cafe opens the source file in the text editor and jumps to the exact line in the source code where the error occurred. Once at the error, Visual Cafe then displays another window with reference information about how the code should be formatted. Creating programs is faster and easier using tools that work together.

A large part of applet and application development involves adding and arranging components on forms and applets. Visual Cafe provides tools to make designing forms a simple process.

What is a visual component in Visual Cafe?  Any visual component, such as a form, applet, or button comprises:

A set of properties
Governs how components display and how they behave. Properties are accessible from the .

A visual element
Shown as an icon in the Project window, and directly editable by double-clicking and opening the component.

A set of event method(s)
Code associated with any number of its events methods are accessible from the Source Window.

One or more interactions
When provided, Visual Cafe translates into code. Interactions are not an integral part of all components.

Each of these component attributes has its own editor, from the Form Designer to the interaction editor, making it easy to manipulate visual components.


The Development Life Cycle: A Two-Step Process

Developing a Visual Cafe applet or application happens in two stages: designing the program and developing it. In the first stage, you design, create, and implement the graphic user interface (GUI) your program will need. You also make a very simplistic arrangement of all the components needed for this program. The second stage is when you bring your project to life by adding and modifying source code, debugging, re-designing, and testing your project.

Step One:  Creating Your Applet or Application

When you start up Visual Cafe, Visual Cafe creates all the project files required for a Visual Cafe applet or application, including source files and the Visual Cafe project file. Visual Cafe then loads these project files, and you can immediately begin working on your project.

To begin working on your applet or application, layout the various components and controls by dragging them from the Component Palette onto the Form Designer.

When you save your work, Visual Cafe saves the whole project as a .vpj file along with all the changes and other files you may have added to your project. The .vpj file is very much like a file folder for storing all of your work.

Step Two: Developing Your Applet or Application

The process for creating an applet or application involves changing or adding source code if necessary, adjusting the properties in the Property List,  working with the Hierarchy Editor and Class Browser, then compiling, linking, testing, and debugging. These steps are iterative, meaning that they are repeated constantly throughout the standard software development process.

Here are procedures that are common to developing both applets and applications:

The first step in developing your program is to create the graphic user interface (GUI) using the Form Designer. Then you draw the components that make up the interface on to the forms you create by dragging and dropping the visual components from the Component Palette.

Next, you set properties for the components you placed on the Form Designer. The  provides a dialog box for you to set properties for all the components on a form. The  is also where you specify the text for all labels.

Now you create Event Methods. Event Methods contain code that is executed when an event occurs, such as when a user clicks a mouse button or enters information through the keyboard. These bound events are called interactions. You create or bind events in source code or use the Interaction Wizard.

Finally, you either run the program directly, otherwise run it in the Debugger to debug your application.


The Differences between Applets and Applications

Visual Cafe applets and applications are cross-platform Java programs that you design, develop and build using the drag-and-drop features of the Windows and Macintosh operating systems through Visual Cafe. The program code used to create applets and applications are fundamentally similar. Both applets and applications are created using the same basic programming concepts.

Because the Web browser is responsible for running an applet, program instructions for applets have a different organization than the instructions for applications.

More about Applets

Java applets, like all Java programs, are made up of source code that is compiled into a .class file.   A reference to the .class file is placed in a Web page. The Web page is downloaded across the Internet using a Java-capable Web browser. As the bytecode contained in the .class file is read, the Web browser’s Java interpreter converts the bytecode into machine specific instructions, executes the program, and displays it.

Another feature of applets is that when they are executed within a Java-capable browser, the applet adopts the look and feel of the client machine’s operating system and native interface controls. This means that a Java applet will look and feel like it was written for the Macintosh when it runs in the Macintosh environment, Windows applets will have the Windows look to them, and UNIX applets will reflect the look of the various flavors of UNIX.

Applets, however, cannot read from or write to a user’s local hard drive. To add this capability to your applet, Symantec has created the database solution dbAnywhere.

When you create an applet with Visual Cafe, you create a subclass of the class Applet in the java.applet package. This applet class enables your applet to work within a Web browser and to utilize the capabilities of the Abstract Window Toolkit. The AWT allows your applet to include user interface (UI) elements, to handle mouse and keyword events and to display to the screen. Although your applet can utilize as many classes as it needs, the main applet class triggers the execution of the applet. It’s signature is as follows:

public class myClass extends java.applet.Applet {
. . .
}

Java requires that your applet subclass be declared as public. This is only true of the main applet class; all other classes may be declared public or private as you desire.

Applets: Advantages and Disadvantages

Java applets have a significant advantage over applications because the Web browser software handles many of the functions that are required to make the applet run.

Standalone applications have overhead that must be written to make the program run properly; a standalone program must be able to start and stop the program, perform memory management, and handle display functions. Although this requires additional programming work, applications do not depend on the presence of a Web browser, nor do they have limitations on the kind of operations they can perform.

Because the browser software provides this functionality for applets automatically, applets are an attractive type of Java program to work with.

Applet Limitations

Sun designed Java to restrict the kinds of operations applets can perform. Limitations are imposed on applets so that a destructive program from a remote computer cannot cause damage to your system. To prevent applets from being destructive, Java enforces the following limitations:

•	Applets cannot read from or write to the file system of the computer viewing the applet. This prevents damage to files and the spread of viruses.

•	Applets cannot run any programs (or parts of programs like DLLs or shared files) on the viewer’s computer.

•	This prevents an applet from calling destructive programs that do not have the limitations of the applet.

•	Applets can only establish connections between the server computer where the applet is stored and the viewer’s computer. This prevents the applet from connecting the viewer’s computer to another server without the viewer’s knowledge.

Java applications do not have these limitations and can be used to build fully functional software programs.

More about Applications

An application is a Java program that runs with a Java Virtual Machine (Java VM)  or a Java compatible browser that is installed on the client system. An application is not displayed on a Web page. Java applications can be built because the Java language includes useful features that are not found standard in other languages. For example, Java comes with existing libraries of program code that make networking and graphics operations easier than ever.

Java applications, unlike applets, can read from and write to the client machine’s hard drive. Applications can create their own frames, title bars, and menus.

Since applications are Java programs that run on their own,  applications can be as large or as small as you want or need them to be. The only class that is needed to run an application is the main method. When you run your compiled Java class with the Java interpreter in Visual Cafe, the main method is called first.

The signature for the main method always looks like this:

public static void main(String args[]) {. . .}

The parts of this line of code have the following meanings:

The public keyword means that the method can be “seen” or used by other classes and components.   The main method  of your application must be declared public for the application to run.

static is a storage class.

The keyword void tells the main method to not return anything.

The main method takes one argument, which is an array of strings. This array is used for command-line arguments outside of Visual Cafe.

For example, the body of the main method contains all the code your application needs to start executing. This Includes code for variable initialization or component instatiation


Java, HTML, and Visual Cafe

HTML stands for HyperText Markup Language. A markup language is made up of a system of tags that preserves a document’s structure so that it can be disassembled, moved electronically, and reassembled when it reaches its final destination. The “Markup” part of HTML refers to tags that affect the way information in a document will be displayed. By using different HTML tags, you control text editing, formatting, how graphics and animations are displayed.

Java is a programming language that allows you to design, build, and execute applications and applets.   Java programs must be coded, compiled, and debugged similarly to development in any other computer programming language before they can be used.

Java is an interpreted, Object Oriented programming language with a syntax and structure similar to C++, designed specifically for the Internet by Sun. One of the fundamental features about the Java programming language is that it is platform independent. Java applets and applications will run on any computer platform that has Java installed on it.

An HTML document can contain links to Java programs so that you can display a Java program alongside regular text in a Web page   Because HTML now supports Java, users get the best of both worlds. Visual Cafe can provide the necessary HTML you need to run and view your applet within Visual Cafe. However, Visual Cafe is not intended as a tool for writing HTML documents. You can achieve this task with Symantec’s Visual Page HTML editing application.

Understanding How HTML and Java Work Together

Applets are designed to be embedded in Web pages. Basic operations such as starting, stopping, and displaying the applet are all handled by the Web browser. In order to tell the Web browser to display the applet, you have to put certain information about the applet in the HTML file.

For the Web browser to be able to display an applet, it requires some basic information. provided through the use of the <APPLET>Tag. Within the <APPLET> tag you specify where to find the .class file, and how large to make the display space within the Web page. Like most HTML tags, <APPLET> has an opening tag, <APPLET>,and a closing tag, </APPLET> . The <APPLET> tag is a link to a .class file that contains bytecode.   The Web browser interprets the bytecode and displays the applet in the Web page.

In addition, there are three attributes for the Applet tag: CODE, WIDTH, and HEIGHT

Passing Parameters to Applets from the HTML File

It is often helpful to have an applet receive information from an HTML document. This allows people to customize how applets appear in their Web pages. To pass information from an HTML document to a Java applet, use the <PARAM> tag.

The <PARAM> can appear between the HTML <APPLET> and  </APPLET> tags. The <PARAM> tag has two attributes,NAME and VALUE tags which are used to pass data to a Java applet.

<APPLET CODE=”MyApplet.class” WIDTH=100 HEIGHT=100>
<PARAM> NAME=”Color” VALUE=”red”>
<PARAM> NAME=”Number” VALUE=”81”>
</APPLET>

The HTML file can pass multiple parameters. After the parameters are set in the HTML file, they can be retrieved by an applet with the getParameter method

String x=getParameter(“Color”);

In the example above, we declare a variable x of type String to hold the Color parameter retrieved from the HTML document. It is necessary to specify the name of the parameter to retrieve from the HTML file.

The parameter is named Color:

<PARAM> NAME=”Color” VALUE=”red”>

The parameter name is specified as the argument passed to getParameter in the applet code.

getParameter(“Color”);

This results in the getParameter method returning the value “red” from the HTML file.


Managing Your Projects in Visual Cafe

The primary component you work with in Visual Cafe is a project. Visual Cafe uses projects to store all the source files that make up your programs. Typical projects include a set of components including forms (such as windows and dialog boxes) and applets. Projects provide vital organization to your programs as they grow more complex. Visual Cafe cannot create a program outside the project environment; meaning you cannot just compile and run a single source file with Visual Cafe. Every Java program you create with Visual Cafe must start out as a project. It is good practice, for organizational reasons, to create a separate directory for each new project you create.

You work with projects in the Project window which allows you to open forms in the Form Designer, open source code and manually create interactions in the Source window.   In the Project window, you can also add and remove files from a project. The Project window lists all forms, components, and classes in a project. Visual Cafe lets you choose how you want to view your project, either as a list of visual components or as a list of source files grouped in packages.

In Visual Cafe, you can also create projects that have no visual elements but are just made up of source code, for example, you may be building a Java component.

Automatic Code Generation for Your Project

As you build or edit an applet, code is dynamically generated for the components in your program. Visual Cafe generates Java source code for your programs and automatically adds the source file to your project. Furthermore, Visual Cafe fully supports two-way editing of visual components. For example, if you open the source code for your applet and change the label of a button or even declare a new button, the change is visible in the form as you write the code.

Double-click a component on your form to open the source window, and the Source Window shows the events available for the component. Visual Cafe also generates event-handler code and embeds it into your project. Select an event from the drop-down list and Visual Cafe inserts a method for the event, and you are ready to add the body code for the method.

Creating Projects

You create new projects from the File menu. Just as a word-processing document contains text and perhaps graphics, projects are containers for forms, components, source file, etc. When a project is created, a Project window is opened and each item in the project is shown in the project list. If you create more than one new project, a Project window is opened for each new project.

Default Projects

When you start Visual Cafe, a new project is automatically created. When the project is generated, the Project window is updated to show an item representing each of the components in the project. Initially, the applet “Applet1” appears in the Project Window. The applet opens in a separate window where the window is active and ready to be edited.

Initially, the default project is a Basic Applet project. The default project type is shown in the New Project dialog box in boldface text with an asterisk before its name. You can change the default project type in the New Project dialog box.


The Component Library

The Component Library window contains all the components in the Component Library. The Component Library can be used to add items to projects, forms,  and to the palette. Components defined in a .class file can be dragged and dropped from the File Manager onto the Component Library to make them permanent components in the library. The default Component Library is installed in the Visual Cafe library directory.

Adding Components to the Component Library

Forms and applets, as well as menu bars and other types of components, can be saved and reused. To save a form as a reusable component, you activate the form window and choose Add to Library from the Object menu. This opens a dialog box where you can enter a name and description and select an icon for the form template.

The Add to Library command adds the component to the Visual Cafe Component Library. When you add a component to the library, all aspects of the component are saved, including any child components such as a form, code, and current property settings.


Understanding Workspaces

Workspaces provide a convenient way to switch from one screen layout to another. Workspaces are task-oriented, as opposed to project-oriented; you create workspaces for different tasks, such as editing, or debugging.

A workspace is a saved arrangement of windows. Because the various tools in Visual Cafe are displayed in many individual windows, workspaces are used to group together the windows that have related functions. Workspaces provide a means of organizing the multiple windows of the development environment into logical groups. For example, when you edit source code you could use a workspace that displays the text editor, the Messages Window, and the Project window. When you are debugging your program, you could use another workspace that displays windows for the different debugging tools.

Visual Cafe supports the extended mouse functions  of the Windows 95 interface. Right-clicking on various components of the windows opens context-sensitive pop-up menus. As you work with Visual Cafe, try right-clicking on the different parts of the screen. You may discover some useful shortcuts!


Creating and Adding Elements to Forms

Forms are the basis for creating a user interface to your applets and applications. With forms, you can create and add components like windows, dialog boxes, graphics, and sound to your applets and applications. You can also use forms as container for items that are not visible components in a user interface. For example, you can have a form in an application that serves as a container for other components that will be used in other programs. Or, you can have a container containing code that handles events like mouse interactions.

Forms are also windows that display information and can receive user input. A form can contain labels that display text, or can contain components that provide interaction with the program. Some examples of components are:

•	Check Boxes

•	Radio Buttons

•	Text Boxes

•	Scroll Bars

To add a component to a form, select the component from the Component Palette and drag it into the Form Designer. The Component Palette contains a variety of components which you can add to forms including standard Java window components. Visual Cafe also includes an extensive list of custom and third-party components.

Editing Properties of Forms

Properties are the characteristics, or data, of a component. You can change a component’s characteristics by using the Property List to change its properties. You can also edit the properties of a form, or the properties of any component on the form.

The Property List allows you quick access to all of the components within the scope of the current form or applet. It shows the name of the selected item and lists the component’s properties. As you add components to a form, or set properties for the components on the form, the Form Designer shows exactly what the form will look like when you run it.

The Form Designer uses the integrated Java Virtual Machine to run Java code at design time. This allows the Form Designer to provide a true what-you-see-is-what-you-get (WYSIWYG) design environment, including the accurate representation of complex layouts using the various Java layout managers. It also allows the Form Designer to run Java components and applets at design time so that the effects of an on-screen animation can be accounted for in the layout design.


Understanding Basic Object-Oriented Programming Concepts

Understanding Classes

Much like the way DNA determine the structure of a living object, classes determine the way objects look and behave. Classes contain the source code, which includes instructions for object creation or instantiation.  When you create a Java source file is generated in your project.   This Java source file contains the form declaration and components.

In Java, a class is a source file (with a .java extension) that contains the code to define a collection of data variables and methods.   The following diagram illustrates what the code for a class looks like:

The AddSub class definition

This is the code for a simple class called AddSub. Note that the AddSub class listed above is not a complete Java program which you can run. There is no main method nor does it extend java.applet.Applet. You may have seen classes containing a main method or extending the Applet class which then have been compiled into programs. But many classes, like AddSub, are only a class definition. They simply specify a class name and define what data and methods the class contains.

In this example, the AddSub class has two variables as its data: the integers num1 and num2. The AddSub class also has three methods: AddSub, AddNumbers, and SubtractNumbers. The first method defines the constructor method because it has the same name as the class, AddSub. The other two methods are called AddNumbers, and SubtractNumbers. These two methods change the data, and return a result.

Once a class has been defined it can be included in your Java programs. However, in order to use any of the data or methods defined in a class, you must write a program that creates components based on the class. The process of creating a component based on a class definition is called creating an instance of a class.

You can access the source for a class component by double-clicking the source file in the Package View of the Project window. Like forms, when you open the component, the primary editor is invoked. In the case of class files, the primary editor is the Source Editor, which is a text editor.

Understanding Components

When you want to make use of the code in a class definition, you need to create an instance of that class. An instance of a class is a variable that contains references to all the data and methods of the class on which it is based. Just as an  int variable is based on the type integer, instances of a class store the data and can access the methods of the class on which it was based. In Visual Cafe, an instance of a class is called a component.

A class is a blueprint that defines a component’s basic data and methods. The class definition is used to define templates of components that can be instantiated and then used in your programs. You can create multiple instances of the same class just as you can create multiple variables of the type int. Once you have created a component, that component contains its own data and provides the methods to access that data. You can use an instance of a class as a starting place for your own component design. You can also add to or re-define existing methods and variables.

For example, suppose you want to write a program that draws a rectangle. First you must think about the characteristics of the rectangle component you  want to model. Some properties of a rectangle are width and height. A behavior of a rectangle is that it can be drawn.

The data for this component could be two integer variables to hold the width and the height, and a method to draw the rectangle.

Defining the data and methods together in a component or class encapsulates the properties and behaviors into a single unit. Once the code for the rectangle has been created, you or anyone else can reuse it whenever you want. Encapsulation and reusability are two of the most beneficial characteristics of an Object-Oriented Programming language.

When you work with components in an object-oriented programming language, you work with the features of that component to make it behave a certain way, or to interact with other components.


Visual Cafe Tools for Working with Classes and Components

Forms,  applets,  and all types of components are edited in the same way in Visual Cafe. When you select a component in the Project Window—a form, for example—or when you open a form and that window is active, you can manipulate the form by using the Object menu commands.

Working with the Class Browser

Classes are the foundation of object oriented programming. To make working with classes easier, Visual Cafe provides an important, and powerful tool for working with classes called the Class Browser.

The Class Browser is a three-pane window that lists all of the classes, methods and data items contained in your program. This tool provides abstraction from the underlying source files by letting you navigate and edit your classes and members quickly. In the Class Browser you are free from the clutter of other member implementations in the same source file. The Class Browser helps you work with your source code in an organized way. It’s not very easy to read a 27 page source file filled with references to multiple classes. You need to be able to keep track of what each of the classes does, what data is in each class, and how the methods within the classes work.

The Class Browser window shows the class hierarchy in your project and allows you to add classes, modify extension relationships, and view and edit class member declarations and definitions. The Class Browser window shows data and methods for each class and an edit area for working directly with the body of a method.

There are three panes in the Class Browser:

The Classes Pane

The Classes pane displays all the classes that are part of the current project. By default the classes are displayed by package.  Your project files will be displayed as part of the default package when you start Visual Cafe because you have not created a package structure yet. In this case, the default package represents the entire project.

The classes may be listed alphabetically, by package, or hierarchically. You can choose to display your classes either alphabetically, or by package.

The Members Pane

The data and methods in a class are called members of that class. The Members pane of the Class Editor gives you an organized look at the data and methods the selected class is made of. The color of the icon indicates level of access for a class. A yellow icon indicates protected, green indicates it is a public class, and blue indicates it’s a package.

Single-clicking a method or variable displays the source code for that member in the Source pane. You can drag and drop a member into the source pane; the member declaration is inserted into the source window.

Right clicking in the Members pane allows you to add new members to the class. You are presented with a dialog box where you can type the declaration of the method or data. You can also choose from a list of methods that can be overridden. The new members are automatically added to the source code for the class.

The Source Pane

The Source pane displays the source code for the member data or method that is selected in the Members pane. You can edit the code for your programs in the source pane. All changes made to the class using the class editor will automatically be added to the associated source file.

Working with the Hierarchy Editor and Classes

The Hierarchy Editor is a visual tool that provides you with a visual representation of the classes in your project, and their inheritance relationships.

All Java programs have a hierarchical structure. You can use the Hierarchy Editor to directly manipulate the class relationships of your projects, by simply dragging and dropping from one class to another.

NOTE Any changes made to classes or inheritance relationships in the Hierarchy Editor are automatically changed in the underlying source code. For that reason, you should be careful when making changes with the Hierarchy Editor. Visual Cafe does not allow you to change the structure of the existing Java hierarchy!

You can extend existing classes just by clicking and dragging. You can also create a new parent-child relationship by clicking a class and dragging to the desired parent class. If you double-click a class, that class is displayed in the Class Editor so you can view its data and methods.

You may also view class data and methods using the Hierarchy Editor's Member and Source Windows.


Working with the Source Editor

The Visual Cafe Source Window is where you can create, display, and edit code. It is a full-featured text editor with many options and features particularly useful when editing Java source code. It provides for full Java syntax highlighting and flexible navigation tools. The Source Window also plays an important role in debugging your project. You can use the Source Window for monitoring program execution while debugging, and for setting breakpoints at design time.

Source Windows are tied to individual components and class files. All methods in a single component are displayed in one Source Window. The active component and a complete list of its events  are displayed next to the source pane. If the event has not yet been bound to a method,  selecting an event name, creates a method for that event. Events that have been bound to a method appear in bold text. When you select a bound event, the method associated with that event name is displayed in the Source Window text box.


Arranging Objects with Layout Managers

The Java language provides layouts (or layout managers) which help you arrange components inside a container,  like a form or a panel.   Layouts provide a method of automatically arranging components within a container so that they display nicely on different platforms, screens, and at different resolutions.

The way AWT components actually appear on the screen is determined by the order in which components are added to the panel that contains them, and the layout manager that panel is using to display them on the screen. The layout manager determines and allocates which components within that panel will be displayed.

Visual Cafe supports all Java layouts, as well as creating your own.

You can add a layout to a form (or panel) by setting the form’s layout property. Immediately when you change the property, the components inside the layout are arranged based on their creation order and the specified layout. You can rearrange components in the layout by dragging and dropping to the desired location.


Designing and Building GUIs with Visual Cafe

With Visual Cafe, you can combine graphical user interface (GUI) elements to your applets or applications and define how those elements should interact with your applet or application.

Visual Cafe updates the source file for you every time you drag and drop a visual component on the form.   The source code is updated automatically. To build the GUI, Visual Cafe updates the source file for an object as you edit visually in the Form Designer. As you drag and drop visual components on a form, and edit properties for components using the Property List, Visual Cafe automatically writes this information in the corresponding source file.


Working with Interactions

Anytime a button is pushed, or a box is checked, a program action called an event is generated. In order to link those events to a corresponding action in your program, you need to include a method that watches for and then responds to that event. The Java method that does this is called HandleEvent.

One of the most powerful features in Visual Cafe is the ability to specify these high-level interactions between components and events. The key elements of any interaction are the trigger event and the action. The trigger event is the originator of the action; the interaction determines when to execute the code. You can add conditions to an interaction just like you would add an If statement in code. The action element is the meat of the interaction; it specifies what to do when the condition is satisfied.

The Interaction Wizard allows you to graphically build relationships between components:  Visual Cafe automatically generates code for the specified relationship.

With Visual Cafe, you use the Interaction Wizard to create the interaction between the visual component and a corresponding events. The Interaction Wizard automatically updates your source code for you.


Working with Basic User Interface Components

The Java Abstract Window ToolKit, or AWT, is a portable GUI library to allow you to create visual front ends. This portable GUI library is cross-platform for developing and running applications and applets.

The AWT supplies many classes for you to develop your Java programs. It is the crucial link between your Java program and the native GUI of the operating system. The AWT performs a very high level of abstraction because there has to be a common denominator in order for your Java program to be portable across platforms. It is a Java package that can be used in any Java program by importing java.awt.* using the import keyword. Visual Cafe does this automatically for you.

Components

In the structure of the AWT, components are added to and then arranged by layout managers in containers.  There are a variety of event handling, menu, fonts, and graphics classes in addition to components and containers. The AWT also works well in conjunction with the networking and threads classes.

Components are what allow you to interact with your program. Components display windows and buttons, lists inside of windows, and allow you to enter text in a field. Components consist of  the visible objects such as Scrollbars, Buttons, and TextAreas, just to name a few, that have been added to a Container.


Understanding Containers

In general, while components are independent objects, there is a certain parent and child relationship that exists between containers and other components.

Java defines containers as components that hold any number of components, including other containers. Containers hold and organize your components, but they also contain code for event handling and many essential things such as controlling the cursor image and the program’s icon. All containers allow for operations such as adding, removing, and painting their contents, or components. Containers allow for grouping of related components together and treating them as a single unit, simplifying the amount of programming you have to do.

To better understand the idea of containers, think of all visual components, as children of the form on which they are displayed. Most components inherit the read-only Parent property, which displays the form.   The placement of visual components is also relative to the Parent form. Visual components cannot be moved outside the boundaries of the parent. Moving a form moves the components as well.


Working with Threads

A thread is a process in a program that has a beginning and an end. In applications,  the main method is responsible for indicating the beginning and end of the program. In applets,  the Web browser uses various methods to control the program flow.

However, programs are not limited to performing a single process. Java programs can use threads to perform multiple processes simultaneously. This is called multithreading. For example, suppose you are using a text editor to type a letter and you want to save your changes before you continue. If the text editor program is single-threaded, when you save the file, the rest of the program must wait until the file is completely written to the hard disk.

In a multithreaded application, the process that saves the file can be an independent thread with its own beginning and end. When you save the file, the file-saving thread starts and runs in parallel with the application’s other processes. You can continue to type your letter as a copy of the file is written to disk in the background. Multithreaded programs run faster and are more convenient than single threaded applications.

In the Visual Cafe Threads window, the active threads are listed one per row. The selected thread is highlighted. You can change the selection by clicking on a different row, or by using the Up and Down ARROW keys. The primary thread is identified by a bold arrow in the left margin. This thread receives user input and is automatically created by the operating system when a process (an instance of an application) is created. The active thread—the one that was active when you entered break mode—is identified by an arrow in the left margin.

When debugging a multithreaded program, you can select a single thread using the Threads window. The Threads window shows all the extant threads your program has created, and the state of each thread.

You can use the Threads window to:

•	Switch easily between threads to debug.

•	View the source for a selected thread.

•	Update the Call Stack window with a thread’s call chain.

•	Update Variables window to show the variables within the current tread.

To open the Threads Window, choose Threads from the Window menu.


$ The Graphics ClassA The_Graphics_Class+ VCGUIDE:0


$ Animation and MultithreadingA Animation_and_Multithreading+ VCGUIDE:0


Understanding Error Messages in Java and Visual Cafe
Understanding Errors in Java and Visual Cafe

Common Errors

The most common compiler errors result from improper syntax.   The compiler can only understand source code that has been formatted correctly. Some of the most common mistakes are:

•	Misspelled words (keywords, methods)

•	Missing, or incorrect separators (periods, braces, semicolons)

•	Improper use of case (capitalization)

One compiler error can generate multiple error messages. For example, you could misspell the name of a method that you call from your program. Although you misspelled it only once, your program may reference the misspelled method multiple times. The result is multiple compiler errors from a single typing error.

Sometimes the compiler error message will indicate exactly what caused the problem. You may have to inspect the troublesome line of code character-by-character to locate the source of the problem.

Compiler errors

A compiler error occurs when the compiler does not understand a portion of your source code. Even in the simplest program, it is easy to write code that will result in a compiler error.

There is a difference between compiler errors and programming errors. For example, if source code fails to compile successfully, you have a compiler error. If the source code compiles successfully but does not run as you expect, you have a programming error. It is possible for a program to compile successfully and still not run. Fixing the logic of your program to get it to run the way you want is called debugging your program.

The Messages Window displays all of the compiler errors encountered each time you build or compile a program.

Using Visual Cafe to Locate Compiler Errors

When the compiler encounters an error in the source code, the error is displayed in the Messages Window. Double-click the error message to jump to the line containing the error. The editor highlights the error. The integration between the Messages Window and the Source Editor saves you from searching through every line of your code to find an error.

Java and Case Sensitivity

Java compilers and interpreters are case sensitive, meaning that upper case letters are distinguished from lower case letters. Hello.java is not the same file as hello.java. The different use of capital letters indicates that these files are not the same.

When a .java source file is compiled, the compiler creates a file with a .class extension. The name that the compiler assigns to that .class file is taken from the class definition in the source file. Essentially, the class you define in the source code becomes the name of your program. Like all things in Java, the class definition is case sensitive.

Because of the case sensitive nature of Java code, compilers, and interpreters, it is important to be careful and consistent when you name projects,  source files, and classes.

To prevent problems resulting from case sensitivity, get in the habit of always naming the project and the main source file with the same case sensitive name as the class you are creating.


Understanding the Visual Cafe Debugger

After writing a program it is not unusual to find that it doesn’t work the way that you expected. Just because a program compiles without errors, does not mean that it will work correctly. Finding and correcting problems within a program is called debugging. Debugging involves finding and fixing bugs in your code. When you run your program, you may encounter a variety of errors, including compile errors (code construction, syntax errors), run-time errors that occur after you start the program (dividing by zero or writing to a file that doesn't exist), and logic errors (program doesn’t do what you want it to do.)

One of the most powerful tools in the Visual Cafe environment is the integrated Debugger. The Debugger allows you to watch your programs execute line by line. As your program executes, you can observe the various components of the program to see how they are behaving. By using the Debugger, you can monitor:

•	The values stored in variables

•	Which methods are being called

•	The order that program events occur

NOTE Your program must successfully compile into a .class file before the Debugger can open it.

When you run the Debugger, Visual Cafe switches into debug mode.   While you are in debug mode you cannot compile your source files, or rebuild your project. To try out your code changes you must first stop the Debugger and recompile your program. Once the program has recompiled, you may restart the Debugger.

While debugging your program, you can use the Source Window,  Class Browser Window, Breakpoints Window,  Variables window,  Call Stack window,  Threads Window,  and Messages Window to help you isolate problems and resolve them. The Source and Class Browser windows are available at all times; the other views are only available after the program is executed.


The Debugging Views

The Debugging views consists of these windows:

Variables

The Variables Window allows you to specify variables and expressions  that you want to watch continuously while debugging your program. In this window, you can examine the contents of a class variable. To watch all the variables accessible to a method, simply drag the method from the Call Stack Window into the Variables Window.

You can add a variable name or an expression to the Variables window by clicking in a cell and typing the name. Variables can be modified by double-clicking in the Value cell and entering a new value. After modifying a variable you can continue debugging from the current line without having to stop and restart the debug session.

Call Stack

The Call Window lists the method calls a program has made since it began running. This list is known as the call stack.  The methods in the call stack are displayed in reverse order from the last (most recent) call on top to the first (initial) call on the bottom. Each entry lists the name of the method followed by the name of the class which contains the method.

Threads

The Thread Window displays the threads that your program has created. A thread is a process that is controlled by your program. It is possible to create programs that have more than one process (thread), running at the same time.

NOTE If you are using multiple threads in your program, each thread has its own call chain. Drag a thread from the thread window and drop it on the call window to see the call chain for individual threads.

Breakpoints

The Breakpoints Window is used to display a list of breakpoints currently set in the source code. Breakpoints are flags you can insert into the code at specific points that cause the program execution to pause. When the Debugger goes through the instructions, it stops whenever it encounters a breakpoint. You can check on the value of the data and other program conditions.

Source Window

The Source Window is the primary debugging view:  it is where you add, edit, and view code. When debugging an application, Visual Cafe automatically opens the Source Window containing the current line of code.


Debugging Applets and Applications

When you debug a program you can execute the instructions in the program line-by-line and watching the result. This allows you to pinpoint the exact source of a problem in a misbehaving program.

There are two basic techniques that can be used to step through method calls in your program code: stepping into, stepping over, and stepping out. Each technique has an associated icon in the Debug toolbox.

Step Into

When you step into your code, the Debugger executes one line of code including any jumps to other methods until it reaches the next line of code. This method allows you to step through the program, executing every statement completely.

When you step into a method call, the Debugger jumps to the code for that method, and steps through it as well. If the code for the method is in a different file, the Debugger opens that file, and jumps right to the code for the method.

Stepping into every line of code, for every method called by your program is not usually the best way to debug a program. For example, let’s say your program calls the println method. We know the println method works, because it is part of the Java language. Stepping into method calls like println throughout a  program can quickly result in a chaos of open windows. A more useful approach to debugging, is to step into some parts of the code and to step over other parts. You can avoid stepping through known working code by stepping over method calls. However, if you stepped in where you should have stepped over, you could step out.

Step Over

Step Over executes one line of code. However, if the current statement is a call to a method, the Debugger executes the method behind the scenes and returns to the next statement following the method call.

By using the Step Over method, you can bypass unnecessarily opening other files, and stepping into every line of code each time a method is called.

Step Out

Step out steps out of a method by pausing just after it.

Editing Breakpoints

Watching an entire program execute from beginning to end helps you understand the program flow. However, it is more likely that there are only specific parts of the program which you want to observe. It makes sense to step through the few specific lines of code which have behavior you want to observe rather than the entire program. In these cases you can use breakpoints. A breakpoint is a flag placed in the source code that tells the Debugger to pause execution of the program.

When you work with breakpoints the Debugger executes all the statements in the program until it encounters a breakpoint. The program pauses at the breakpoint so you can check the state of the program at that point, including checking the value of variables. As you debug your code, you can use as many breakpoints as you want.

To set breakpoints in your program, position your cursor on the line where you want to pause execution and click on the Set Breakpoint icon in the Debug Toolbar.


Working with Exceptions in Java and Visual Cafe

The Java language uses exceptions as a means to process errors in its programs. An exception is an event that occurs during the execution of your program that interferes with, disrupts, or stops the normal flow of instructions.

Throwing Exceptions

Many types of errors force the Java run time system to throw exceptions—from simple programming errors to a hard disk crash. When such an error occurs within a Java method,  the method creates an exception component and passes it  to the Java run time system. This exception component contains important information about the exception, including its type and the state of the program when the error occurred. The run time system tries to find a piece of code to handle the error. This process of creating an exception component and passing it to the Java run time system is called throwing an exception.

Catching Exceptions

After a method throws an exception, the Java run time system finds a way to handle the exception. One set of  possible tools to handle exceptions is the set of methods in the call stack  of the method where the error occurred. The Java run time system scans backwards through the call stack, starting in the method where the error occurred, until the Java run time system locates a method that has a suitable exception handler. An exception handler is suitable if the type of the exception thrown is the same as the type of exception handled by the exception handler. The exception moves up through the call stack until a suitable handler is found and one of the calling methods handles the exception. This is called catching the exception. If the runtime system searches all of the methods on the call stack without encountering a suitable exception handler, the runtime system as well as the Java program terminate.

Setting Exceptions in Visual Cafe

You can view and set the exceptions options by choosing Exceptions from the Debug options drop-down list in the Project Options dialog box. To stop whenever a particular exception occurs, check the box to the left of the exception name. When this options is set, the program stops whenever the exception is encountered regardless of whether your program handles the error or not. The default behavior for exceptions is for the Debugger only to stop if a particular exception is not handled in the source code.


# Maintaining_and_Porting_Your_Java_Applets_and_Applications$ Maintaining and Porting Your Java Applets and ApplicationsK Maintaining;Porting; Java;Applets;Applications;DebuggingA Maintaining_and_Porting_Your_Java_Applets_and_Applications+ VCGUIDE:0


# Using_Visual_Caf_to_create_Java_Solutions$ Using Visual Cafe to create Java SolutionsK Using Visual Cafe to create Java Solutions+ VCGUIDE:0Cafe


Two-Way tools

In Visual Cafe, you have the option to use many of the visual tools available, or write your source code. As you use any of the visual tools, the source code is automatically generated and updated for you as you work.


.class files

Are created when you compile your Java program with the Java compiler. For applications, .class files are interpreted by the Java Virtual Machine on each platform, for appletts or by a Java-enabled browser.


Parent Language

When a portion of a programming language is taken from a larger language, the original language is called the parent language.


Interpreted Language

Some languages like C and C++ compile programs into instructions for specific machine processors. Other languages, like Java, compile programs into bytecodes, which are non-processor specific. An interpreter, like the Java Virtual Machine, must run on each platform and interpret the bytecode to run the program on that particular platform.


The Internet

The global network of computers.


platform

A particular computer or particular operating system, or a combination of both.


Web Page

A Web page is an HTML document that is transmitted over the World Wide Web (WWW.) It can be any combination of text, graphics, animation, and sound. Web pages often contain links to other web pages. Web pages also run applets.


Web Browser

A Web browser is an application that is used to display web pages for the World Wide Web.


tag

Used in HTML to indicate how specific pieces of text, sound, and graphics are to be formatted and displayed. Tags are also used to indicate to the Web browser that there is an applet embedded within the code.


attribute

Extra information that can used by certain HTML tags.


$ source code

The list of machine instructions in a particular programming language to be compiled and interpreted or executed.


interface

What a program user sees and uses to interact and accomplish tasks with a particular computer program. A Java interface is a template for assigning certain specified behaviors to classes.


overhead

The total amount of resources from the computer that a program needs or uses during its execution.


Dynamic-Link Libraries (DLLs)

A component of Microsoft Windows programs that contain resource files a program uses as needed rather than having these libraries compiled into the program.


argument

Information that is passed to a method. Arguments allow methods to perform their operations on different data making them more versatile.


instance

An component based on a class definition that you use in your programs. An instance is like a variable that represents a class and all it's data and methods. You can have multiple instances of a single class.


abstraction

Removing the unimportant characteristics and details of a component so that only the essential aspects and characteristics remain to describe it.


modifier

Keywords that assign characteristics to various program components like variables, methods, and classes.


controls

Used for accepting and displaying user input and displaying it. Some examples of controls are text boxes, command buttons, and list boxes. Each control has its own set of properties, methods, and events.


debugging

Correcting the logic of your program to get it to run the way you intend.


syntax

The important word order in programming source code.


UI

User Interface. The collection of visual components in a window that collects and displays user input.


WYSIWYG

What You See Is What You Get. Originally, this term came out of the development of word processors from cryptic, command line processing of text to creating documents such that the printed (hard copy) looks exactly like what you see on your monitor.


variables

A symbol, or character, used to represent data.


expression

A collection of variables and operators that specify a computation.


Call Stack

An area reserved in memory by the compiler to keep track of all method calls that are made.


URL

An address of a resource on the Internet. (Acronym for Uniform Resource Locator).


instantiation

The act of creating a new instance of a class. This is done using the new operator.


The CODE Attribute Tag

Tells the browser the name of the .class file to load and run. Using the CODE tag the browser looks for the .class file in the same directory as the HTML file. If the .class file is in a different directory than the HTML file that displays the applet, you need to also include a CODEBASE attribute that specifies the directory where the .class file is located.


The WIDTH Attribute Tag

Specifies the length (or WIDTH if you prefer) of the display area inside the Web page. If the Length parameter is smaller than the applet, the parts of the applet outside the display area will not be visible.


The HEIGHT Attribute Tag

Specifies the height of the display area inside the Web page. If the height parameter is smaller than the applet, the parts of the applet outside the display area will not be visible.


The NAME Attribute Tag

The name of a parameter the Java applet can request.


The VALUE Attribute Tag

VALUE is the information held by a parameter.


The getParameter Method

The getParameter method always returns a text string:

String x=getParameter("Color");

Color is the name of a parameter specified in an HTML document.


ToolTip

When you move the mouse over a component on the Component Palette and pause for a moment, a ToolTip is displayed. ToolTips show a brief one or two word description of the functionality for the active toolbar button or component. The status bar shows a more detailed description of the tool.


data

The information programs operate on.


constructor method

A method with the same name as the class that contains it. Constructors are used to perform initialization operations when an object is first created.


encapsulation

The concept of collecting the data and methods together into a complete object. Encapsulation collects the properties and behaviors into a single independent module that can be reused in multiple programs without modification.


reusability

The ability to use the same source code that defines an object in multiple programs without modification.


extend

Creating a new object that can use all the data and methods from an existing object. This is also called inheritance.


Glossary of terms


Access type

Specifies the scope of a variable or method in code.

Access type	Description
Public	Public objects are accessible from outside the member's class. This is the default type.
Protected	Protected objects are accessible only within the member's class, derived classes, and their associated objects.
Private	Private objects are accessible only within the member's class and its friends.
Package	Available to any class in the package (excluding subclasses that are not in the same package).


Active window

The window which receives keyboard input.  Only one window can be active at any time.


Applet

A program that can be added to a Web page and run by Java-enabled Web browsers (or the AppletViewer).


Application

An extension of Frame, the class created from the Application template is a good base class for a main application window. It can exist by itself, contain components and menus, and can be used to show dialogs and windows.


Visual Cafe window

The main development environment window that contains the menu bar and tool bars that you use to interact with Visual Cafe tools and views.


Boolean expression

An expression that evaluates to true or false.


Debug mode

Temporary suspension of a running program.  In break mode, you can edit code, edit forms, set or clear breakpoints, restart, step, or stop your application.


Breakpoints window

Contains a list of all breakpoints in a project.  Use this window to add, remove, or modify breakpoints.


Bytecode

Machine-independent code generated by the Java compiler and executed by the Java interpreter.


Call Stack window

At runtime, this window shows all the active method calls leading to the current process.  When a method is called, it is added to the stack. When the method returns, it is taken off the stack.

The currently executing method appears at the top of the stack and older method calls appear below that.


Class

A collection of attributes and methods that defines the implementation of a particular kind of object.

A class definition defines instance, class variables, methods; as well as specifying the interfaces the class implements and the immediate superclass of the class.


Class Browser

Shows the classes and methods in the project, and an edit area for working with source code for a method.


Class member

A variable or method defined in a class.


Class method

An action as defined by and associated with a class.  It is also any method that can be invoked using the name of a particular class.


Class variable

A data item associated with a particular class as a whole and not with particular instances of the class.


Component

A visual object that allows users to interact with your program.

You can customize the properties of a component or edit events for a component to changes its run-time appearance and behavior.  Access components and other visual objects in the Component Palette or in the Component Library window.

Components are called “controls” in C++.


Conditional breakpoint

Conditional breakpoints are sophisticated breakpoints that allow you to stop the execution of the program only when a specified expression evaluates to true.


Container

Components that can contain other components. Forms and Panel components act as containers to which you can add other components.


Context menu

A menu that appears when you click the secondary mouse button in a Visual Cafe window.


Control

In Visual Cafe, the term "control" is similar to "component."


Debug mode

Temporary suspension of a running program.  In debug mode, you can edit code, edit forms, set or clear breakpoints, debug threads, and view the calls on the call stack.  After making any edits, you must restart execution to see the affect of the changes.


Debug Toolbar

Contains single-button shortcuts to: Start/Resume/Stop execution, Step Into/Over a Method, Toggle a Breakpoint, Watch a Variable.


Debugging Window

The source window changes from editing to a debugging window when you start debugging.


Declaration

A statement that establishes an identifier and associates attributes with it, without necessarily reserving its storage for data or providing the implementation for methods.


Definition

A declaration that reserves storage for data or provides implementation for methods.


Design time

The time when you build an application in the development environment by creating forms, adding components, and changing the look and behavior of components in your project.


Dialog

A simple window with a title bar that can receive and process input from a user. Dialogs cannot be used by applets, and are not suitable for use as a main window for an application. Dialogs can contain components, but not menus. Use dialog for temporary windows.


Event

An action or occurrence to which an object can respond. Events are typically user actions that the program can capture and respond to. Examples of  events include mouse clicks, key presses, and mouse movements.


Form

A container for components that the user can work with at runtime.  Windows, dialog boxes, message boxes, and applets are some of the Visual Cafe form types.

You can use form components to display other components or forms.


Frame

A general-purpose window to which you can add components and menus.


Garbage collection

The automatic detection and freeing of memory that is no longer in use.  The Java runtime system performs garbage collection so that programmers never explicitly free objects and other data.


Global view

Views that are accessible from the Window menu.

Global views include the Property Inspector, Hierarchy Editor, Class Browser, Watch window, Breakpoint window, Call Stack window, Component Palette, and Component Library window. The Project window, Source windows, and forms are local to a project.


Interaction

A relationship you define between two or more visual objects resulting in Visual Cafe-generated code. You can create an interaction between objects on one form, or between a component on one form and another form. An interaction consists of two component, a trigger event, and an action.

For example, you can connect a button (the trigger component) to a text box (the action component) so that when the user clicks on the button (the trigger event), the associated text box is enabled for user input (the action).


Java Virtual Machine

The Java Virtual Machine (Java VM) contains a bytecode translator that converts the downloaded binary Java files into instructions to be executed by the client machine. The Java VM also contains the routine libraries that are called by the Java applet.


Identifier

The name of an item in a Java program.


Inheritance

The concept of classes automatically containing the variables and methods defined in their superclasses.


Instance

A data item based on a class. Any one of a set of components sharing the same class.

For example, multiple instances of a Form class share the same code and are loaded with the same components with which the Form class was designed.  During runtime, the individual properties of components on each instance can be set to different values.


Instance method

Any method that can be invoked by using an instance of a class, but not the class name.


Instance variable

Any item of data that's associated with a particular object.  Each instance of a class has its own copy of the instance variables defined in the class.


Invisible object

Invisible objects are components that are visible during form design and invisible at runtime. An example of an invisible object is a menu bar.

Because these components are invisible at runtime, you have the option to hide invisible components by toggling Layout [image] Invisibles.


Java File

Contains visual objects and source code.  Components are common objects, such as applets, forms and buttons, used to create a visual interface.


Layout

A property of container objects like forms and panels that automatically arranges components within the container so that they display well on different platforms, screens, and at different resolutions.


Local variable

A data item known within a block, but inaccessible to code outside the block.  For example, any variable defined within Java method is a local variable and can't be used outside the method.


Macro

The Source editor has powerful macro facilities. You can record a sequence of keystrokes, save the sequence as a named macro, assign a keyboard shortcut to the macro,  and edit the macro.


Method

A procedure that acts on a class component.


Messages Window

Displays all Visual Cafe informational and error messages. For example, if an error is encountered during parsing, the error message is displayed here.  You can double-click on an error message to open the file in which the error was detected.


Modal

Describes a window or dialog box that requires you to take some action before the focus can switch to another form or dialog box.


Modeless

Describes a window or dialog box that does not require user action before the focus can be switched to another form or dialog box.


Non-visual object

A class defined in source code only.


Object

An object can be either a visual object or a non-visual object.


Component Library

Contains all the objects you can use to build a program.  When you create a project template or add an item to the palette, the object is stored in the object library.  To view the contents of the object library, choose the Object Library command from the Window menu.


Objects View

A view of the project that lists only visual objects.  You can expand forms, other containers, and menus to show the components on the form.


Overloading

Using one identifier to refer to multiple items in the same scope.  In the Java language, you can overload methods but not variables or operators.


Overriding

Providing a different implementation of a method in a subclass of the class that originally defined the method. Overridden methods have the same name but take different parameters.


Package

In the Java language, a group of classes. Packages are declared with the "package" keyword.


Packages View

A view of the project that lists both visual and non-visual components.


Component Palette

Provides quick accessibility to tools that can be used to add commonly-used components to a project.  You can place any component in the component library on the Component Palette.


Panel

General purpose containers that can be added to another container.  Panels have no visible border and  can be used to break up windows into logical regions.


Project

A set of visual objects (components) and code that integrate to form an applet or application.


Property

A named attribute of a visual object or component.

Properties define component characteristics such as size, color, label, or the state of an object, such as enabled or disabled.


Property list

A window that displays the design-time properties of an object when you choose its Properties command.


Regular Expression Syntax

Regular expressions enable regular expression matching. The pattern you search for can be a text string or a regular expression.  Regular expressions are wild card characters.

The following characters are supported:

?	Matches any character.
*	Matches zero or more occurrences of any character.
@	Matches zero or more occurrences of the previous character or expression.
% or <	Matches the beginning of a line.
$ or >	Matches the end of a line.
[...]	Matches any of the characters listed between [ and ]. A hyphen (-) may be used to specify a range of characters. For example, [abc] matches a, b, or c: [a-z] matches any lowercase letter; [A-Za-z] matches any upper or lowercase letter.
[~...]	Matches any character except those listed between  [~ and]. A hyphen (-) may be used to specify a range of characters. For example, [~A] matches any character but A; [~abc] matches any character except a, b, or c; [~A-Za-z] matches any non-alphabetic character.
\	Escape character indicating that the following character should be taken literally rather than used as a wild card character. For example, \* may be used to search for an asterisk; \\ may be used to search for a backslash character.
\t	Matches a tab character.
\f	Matches a formfeed character.


Run Mode

The time when your program is running and you can interact with your program as a user. When you are in run mode, the Project Menu is replaced by the Debug Menu that provides debugger-specific choices.


Runtime

The time when your program is running.  At runtime, you can interact with your program like a user.  You can pause the application and start debugging by pressing CONTROL+BREAK.


Scope

Defines the accessibility of a variable or method.  For example, a variable declared as Public is visible to all methods in all modules.  Variables declared in methods are visible only within the method and lose their value between calls unless they are declared Static.


Source pane

An interface element in the Source window and Class Browser that allows you to view and edit code.


Source Window

A window or pane where text editing is performed on your source code.


Anchor component

This component acts as the reference point when a group of components is being aligned or sized.  When you select multiple components, the last component selected is the standard; it has distinct, colored selection handles.


Project Template

A collection of objects that you can use as the base of your application or applet. When you select a template for a new project, the new project inherits all of the template's objects.

Types of project templates that you might create include web site projects, single document projects, database projects, applets, and component projects.


Thread

A path of execution in a running application.  You can create threads in your application code which can handle background processes, for example, that execute without the user’s notice.


Threads Window

At runtime, this window shows all the existing threads your program has created, and the state of each thread.


Variables Window

At runtime, this window shows the variables that are active in the current context. You can change the value of a variable at runtime by editing its value in this window.


ValueTip

Value tips display at runtime, in debug mode, when you put your mouse over a variable in the Source Window.  A ValueTip shows the value of the variable under the cursor.


View

A window that shows a particular type of information. Visual Cafe has these global views: the Property List, Class Browser, Hierarchy Editor, Component Palette, Output window, Breakpoints window, Watch window, Variables window, Threads window, Project Window, Source Window, and Call Stack window.


Visual object

A class defined by a set of properties, a visual element, a set of event methods and associated code, and an optional interaction.

A visual object may contain other components.

Forms, components, and applets are examples of visual objects.  You can customize the appearance of visual objects by changing their properties. You can customize their behavior by writing code.


Watch window

At runtime, this window displays the value of a variable or expression you enter.  You can modify these values directly in this window.


Window

An area that has no borders and no menu bar.


Workspace

A saved window arrangement. Your workspace is saved automatically while you work.